<?php
require_once "jssdk.php";
$jssdk = new jssdk("wxe6de21287cb9e5eb", "7b550f9b1bd51a23146468c675d3a61f");
$signPackage = $jssdk->getSignPackage();
?>
<!DOCTYPE html>
<html lang="en">
  <head>
    <meta charset="utf-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width,initial-scale=1.0">
    <link rel="icon" href="<%= BASE_URL %>favicon.ico">

    <link rel="stylesheet" href="<%= BASE_URL %>static/css/cropper.min.css">
    <script type="text/javascript" src="<%= BASE_URL %>static/js/jquery.min.js"></script>

    <title>遇见朱鹮 为爱打call</title>
    <script src="./jquery.js"></script>
    <script src="./jweixin.js"></script>
    <script type="text/javascript">
    window.miva = false
        wx.config({
            debug: false, // 开启调试模式,调用的所有api的返回值会在客户端alert出来，若要查看传入的参数，可以在pc端打开，参数信息会通过log打出，仅在pc端时才会打印。
            appId: "<?php echo $signPackage['appId']; ?>", // 必填，公众号的唯一标识
            timestamp: "<?php echo $signPackage['timestamp']; ?>", // 必填，生成签名的时间戳
            nonceStr: "<?php echo $signPackage['nonceStr']; ?>",   // 必填，生成签名的随机串
            signature: "<?php echo $signPackage['signature']; ?>", // 必填，签名，见附录1
            jsApiList: [
                'onMenuShareTimeline',
                'onMenuShareAppMessage'
            ] // 必填，需要使用的JS接口列表，所有JS接口列表见附录2
        });

        wx.ready(function () {
            var share = {
                title: '遇见朱鹮  为爱打call',
                desc: '让朱鹮看看谁是才你心中的理想型？',  // 分享描述
                link: 'http://www.unmcc.com/unmcc/2019/08/hzqx/', // 分享链接
                imgUrl: 'http://www.unmcc.com/unmcc/2019/08/hzqx/fenxiang.png?123', // 分享图标
                type: 'link', // 分享类型,music、video或link，不填默认为link
                dataUrl: '',  // 如果type是music或video，则要提供数据链接，默认为空
                success: function () {
                    // 用户确认分享后执行的回调函数
                    $.post("{:U('Index/setshare')}", function (data) {
                        if (data.status == 1) {
                            window.location.href = "{:U('Index/index')}";
                        }
                        return false;
                    });
                },
                cancel: function () {
                    // 用户取消分享后执行的回调函数
                }
            }

            //“分享到朋友圈”按钮点击状态及自定义分享内容接口
            wx.onMenuShareTimeline(share);

            //“分享给朋友”按钮点击状态及自定义分享内容接口
            wx.onMenuShareAppMessage(share);

        });

        wx.error(function (res) {
            // alert(res.errMsg);
        });
    </script>

  </head>
  <body>
    <style>
        .nick-name {
            display: none
        }
    </style>
    <noscript>
      <strong>We're sorry but qixi doesn't work properly without JavaScript enabled. Please enable it to continue.</strong>
    </noscript>
    <div class="nick-name"></div>
    <div id="app"></div>
    <!-- built files will be auto injected -->
    <audio ref="bgm" preload="auto" id="bgm" src="<%= BASE_URL %>bgm.mp3" />
  </body>
</html>
